
#region Imports

using System;
using System.Collections.Generic;
using System.Text;

using Justa.Model;

#endregion

namespace Justa.Mock
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    public class MockService : IMockService
    {
        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="price"></param>
        /// <param name="count"></param>
        /// 
        /// <returns></returns>
        /// 
        public string Calculate(decimal price, long count)
        {
            Console.WriteLine("calculating...");
            return string.Format("<Cost>{0}</Cost>", price * count);
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="price"></param>
        /// <param name="count"></param>
        /// 
        /// <returns></returns>
        /// 
        public string FailCalculate(decimal price, long count)
        {
            Console.WriteLine("throwing exception from calculate...");
            throw new ApplicationException("Failed to calculate total.");
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <returns></returns>
        /// 
        public EntityCollection<string> GetNames()
        {
            EntityCollection<string> result = new EntityCollection<string>();
            result.Add("Abel");
            result.Add("1800Abel");
            result.Add("CDCJacob");
            result.Add("1800Amin");
            return result;
        }
    }
}
